package com.qin.mall.service.Impl;

import com.qin.mall.mapper.PmsSkuStockMapper;
import com.qin.mall.model.PmsSkuStock;
import com.qin.mall.model.PmsSkuStockExample;
import com.qin.mall.service.PmsSkuStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Leisure
 * create 2022 2022/10/14 15:41
 **/
@Service
public class PmsSkuStockServiceImpl implements PmsSkuStockService {
    @Autowired
    private PmsSkuStockMapper skuStockMapper;

    @Override
    public List<PmsSkuStock> getList(Long pid, String keyword) {
        PmsSkuStockExample example = new PmsSkuStockExample();
        example.createCriteria().andProductIdEqualTo(pid).andSkuCodeLike("%" + keyword + "%");
        return skuStockMapper.selectByExample(example);
    }
}
